<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>找回密码</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/findpass.css">

    <!-- <style>
        /* html,body{
            width: 100%;
            height: 100%;
            background-color: rgb(17, 170, 25);
        } */
        /* html,body,div{
            padding: 0%;
            margin: 0%;
        } */

        #login{
            width: 100%;
            height: 100%;
            background-color: rgb(20, 7, 95);
        }
        .login{
            margin-left: 0px;
        }
        .login-box{
            width: 100%;
            height: 100%;
            background:url(../imgs/three.png) 0 0 no-repeat;
            background-size: 100% 100%;

            display: flex;
            justify-content: center;
            align-items: center;
        }
        .from-box{
            width: 400px;
            /* height: 480px; */
            min-height: 400px;
            background-color: rgb(242, 245, 239);
            border-radius: 15px;
            padding: 15px;
            box-sizing: border-box;
        }
        .title{
            text-align: center;
            font-size: 30px;
            color: #1296db;
        }
        .from{
            padding: 15px 15px;
        }
        .col{
            margin-top: 15px;
            padding-bottom: 15px;
            display: flex;
            align-items: center;
            width: 100%;
        }
        .label{
            font-size: 20px;
            color: #000;
            font-weight: 500px;
            width: 100px;
            text-align: right;
            margin-right: 5px;

        }
        .inpcol{
            margin-top: 0px;
            flex: 1;
        }
        .inpcol2{
            margin-top: 0px;
            flex: 1;
        }
        input{
            height: 45px;
            width: 100%;
            padding: 0 10px;
            box-sizing: border-box;
            outline: none;
            border:1px solid #999;
            border-radius: 6px;
            font-size: 18px;
            line-height: 45px;
            color: #000;
            background: transparent;
            font-weight: bold;
        }
        .btns{
            margin-top: 40px;
        }
        .btns2{
            margin-top: 20px;
        }
        .btn-login{
            width: 100%;
            height: 45px;
            /* background-color: brown;*/
            background: linear-gradient(#1296db,#f56c6c);
            color: #fff;
            border: none;
            outline: none;
            border-radius: 10px;
            font-size: 18px;
            cursor: pointer;
        }
        .btn-login2{
            width: 20%;
            height: 30px;
            background-color: rgb(27, 138, 228);
            /* background: linear-gradient(#1296db,#f56c6c); */
            color: #fff;
            border: none;
            outline: none;
            border-radius: 10px;
            font-size: 5px;
            cursor: pointer;
        }
        .btn-login:hover{
            opacity: 0.6;
        }
        .btn-login2:hover{
            opacity: 0.6;
        }
        .rows{
            display: flex;
            justify-content: space-between;
            margin-top: 4px;
        }
        .item{
            text-decoration: none;
        }
        .aleft{
            color: #1296db;
        }
        .aright{
            color: #f56c6c;
        }
    </style> -->

</head>

<body>

    <div class="findbox">
        <video 
            src="https://qkodo.playlistmusic.com.cn/transcode_1080/video/3b0357d8859fe23c255d90851144e623.mp4" 
            class="video"
            muted
            autoplay
            loop 
        ></video>

        <div class="big-box">
           <div class="form-box">
                <h2 class="title">找回密码 </h2>
                <form action="" class="form">
                    <div class="col">
                        <div class="label">手机号:</div>
                        <div class="inpcol">
                            <input type="text" required name="stu_phone" placeholder="请输入手机号">
                        </div>
                    </div>
                    <div class="col">
                        <div class="label">验证码:</div>
                        <div class="inpcol">
                            <input type="text" class="codeinp" required name="stu_code" placeholder="请输入验证码">
                            <button class="sentbtn" id="sentbtn">发送验证码</button>
                        </div>
                    </div>
                    <div class="col">
                        <div class="label">新密码:</div>
                        <div class="inpcol">
                            <input type="text" required name="stu_password" placeholder="请输入新密码">
                        </div>
                    </div>

                    <div class="btns">
                        <button class="btn-submit sentbtn">修改密码</button>
                        <div class="rows">
                            <a href="./login.html" class="item left">登录</a>
                            <a href="./register.html" class="item right">注册</a>
                        </div>
                    </div>
                </form>
           </div>
        </div>
    </div>

    <!-- JS效果 -->
    <script>
        var sentbtn = document.getElementById("sentbtn"); // 找到这个DOM 元素 
        var nums = [0,1,2,3,4,5,6,7,8,9];
        var code = '';
        var timer = null; // 计时器对象 
        var count = 60;   // 倒计时的时间

        // 生成4位数字验证码
        function getCode(){
            var code = '';
            for(var i=0;i<4;i++){
                code+= nums[Math.floor(Math.random() * nums.length )]
            }
            return code;  // 返回最新的验证码 
        }

        // 绑定点击事件 
        sentbtn.onclick = function(){
            code = getCode()
            alert('当前的验证码是 ==== ' + code);
            timeDownStart()

        }

        function timeDownStart(){
            count--;
            sentbtn.innerHTML = "剩余 " + count +" S";
            sentbtn.style.background = '#ccc';
            sentbtn.disabled = true;  // 禁止点击 
            if(!timer){
                timer = setInterval(()=>{
                    if(count>0){
                        count--;
                        sentbtn.innerHTML = "剩余 " + count +" S";
                    }else{
                        clearInterval(timer) // 清除计时器
                        timer = null;
                        count = 60;
                        sentbtn.innerHTML = "发送验证码";
                        sentbtn.style.background = '#f56c6c';
                        sentbtn.disabled = false ;  // 可以点击 
                    }
                },1000) // 1000 毫秒 = 1秒  间隔1s 执行一次 
            }   
        }
    </script>

    <!-- <div class="login" id="login">
        <div class="login-box">
            <div class="from-box">
                <h2 class="title">找的回来莫急</h2>

                <form action="/api/login" method="get" class="from">
                    <div class="col">
                        <div class="label">手机号：</div>
                        <div class="inpcol">
                            <input type="text" required name="stu_account" placeholder="输入账号">
                        </div>
                    </div>

                    <div class="col">
                        <div class="label">验证码：</div>
                        <div class="inpcol2">
                            <input type="password" required name="stu_password" placeholder="输入密码">
                        </div>
                        <button class="btn-login2" type="submit">发送验证</button>
                    </div>

                    <div class="col">
                        <div class="label">新密码：</div>
                        <div class="inpcol">
                            <input type="password" required name="stu_password" placeholder="输入密码">
                        </div>
                    </div>

                    
                    
                    <div class="btns">
                        <button class="btn-login" type="submit">确认修改</button>
                        <div class="btns2"></div>
                        <button class="btn-login" type="submit">重置</button>
                        <div class="rows">
                            <a href="./login.html" class="item aleft">登录</a>
                            <a href="./register.html" class="item aright">注册</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div> -->
    
</body>
</html>